package com.example.sulingorder.controller;

import com.example.sulingorder.entity.OrderReleaseinfoEntity;
import com.example.sulingorder.service.OrderReleaseinfoService;
import com.xiao.sulingpublic.utils.PageUtils;
import com.xiao.sulingpublic.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 * 订单帮领需要的信息表
 *
 * @author xiao
 * @email 1322127758@qq.com
 * @date 2022-03-15 15:04:36
 */
@RestController
@RequestMapping("sulingorder/orderreleaseinfo")
public class OrderReleaseinfoController {
    @Autowired
    private OrderReleaseinfoService orderReleaseinfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("sulingorder:orderreleaseinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = orderReleaseinfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{oorId}")
    //@RequiresPermissions("sulingorder:orderreleaseinfo:info")
    public R info(@PathVariable("oorId") Long oorId){
		OrderReleaseinfoEntity orderReleaseinfo = orderReleaseinfoService.getById(oorId);

        return R.ok().put("orderReleaseinfo", orderReleaseinfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("sulingorder:orderreleaseinfo:save")
    public R save(@RequestBody OrderReleaseinfoEntity orderReleaseinfo){
		orderReleaseinfoService.save(orderReleaseinfo);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("sulingorder:orderreleaseinfo:update")
    public R update(@RequestBody OrderReleaseinfoEntity orderReleaseinfo){
		orderReleaseinfoService.updateById(orderReleaseinfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("sulingorder:orderreleaseinfo:delete")
    public R delete(@RequestBody Long[] oorIds){
		orderReleaseinfoService.removeByIds(Arrays.asList(oorIds));

        return R.ok();
    }

}
